Or How to Track the Original (or First) Referrer of a Conversion using Google Analytics
The purpose of this post is to answer one specific question: How to find out exactly which Google Adwords Display Network site was responsible for a conversion recorded in the Goal Funnel Visualization section in Google Analytics.
Now, I am sure there is more than one way to do this. I am sure there are cleaner, easier, simpler methods of doing this than my way. But as my Indian coding brothers like to say, “I didn’t found one” – not one that worked consistently and under all cases, at least. Admittedly, this way is a bit complicated, consists of a lot of steps, and isn’t all that intuitive. But it works. Our team spent two days researching, testing, tweaking, over many different test cases. So, we’re confident it works and are excited to share it with you.
Can’t You do This With Adwords Conversion Tracking?
Supposedly, you can do this with Adwords Conversion Tracking, as Brad Geddes explains here. However, we needed to do this for a client account, which complicates things. In order for Conversion Tracking to work, you have to be able to link your Adwords and Analytics accounts (I think). But you can only do this if the Adwords and Analytics account are under the same Google Account credentials .. or something. At any rate, we couldn’t figure out how to do it this way. We are managing the client’s Adwords campaign inside our own Adwords account, but the client is sharing the analytics data with us from inside their own Analytics account. So, linking the two – we couldn’t figure out how to do that. (I don’t even think it’s possible when the Adwords and Analytics accounts have different usernames, but if someone else knows how, by all means, share!)
What You Will Need
- The Filter Manager – You will need to create two custom filters which we will show you later.
- Manual URL Tagging – with a slight modification
- Javascripts mentioned below
- A webserver to upload a .js file to be called remotely
The Steps
1. Add the GA Initial Referrer .js file to your webserver. You can find the script on our website here. (Note: Please ignore the other scripts and samples on this page; this is a testing page we use to house some coding we’re working on). Kudos to John Henson at LunarMetrics, Brad at the ROI Revolution Blog, and Brian Clifton’s first referrer tracking scripts. Scroll down to the section called “GA Initial Referrer Script”. Copy this to a text file, rename the .txt extension to a .js extension, and upload to your webserver. Remember the path because you will need it later.
2. Add the GA Initial Referrer Script 2 .js script to the web pages you want to track. You can find the script on the same page as in # 1, in the section titled “GA Initial Referrer Script 2”. Add this just above your existing Google Analytics tracking scripts, on all pages. You may even add this script on your confirmation pages as well. Your revised tracking script should look like this:
Note that you will need change the path of the first line of